<template>
    <div class="media-item">
      <Card :dis-hover="true">
        <!--S用户信息-->
        <template slot="title">
            <Avatar class="avatar" :src="data.user.avatar" />
            <p class="nickname">{{data.user.nickname}}</p>
        </template>
        <!--E用户信息-->
        <div class="content">
          <img @click="$emit('max')" :src="data.thumb" />
          <ButtonGroup class="handle-button">
            <Button size="small" type="success" @click="$emit('pass')">通过审核</Button>
            <Button size="small" type="error" @click="$emit('delete')">删除</Button>
          </ButtonGroup>
        </div>
      </Card>
    </div>
</template>

<script>
export default {
  name: 'item',
  props: {
    data: {
      type: Object
    }
  }
}
</script>

<style scoped lang="less">
.media-item{
  width: auto;
  .avatar{
    width: 30px;
    height: 30px;
    border-radius: 15px;
    float: left;
    margin-right: 5px;
  }
  .nickname{
    display: inline-block;
    width: 120px;
    height: 100%;
    line-height: 30px;
    font-weight: normal;
    font-size: 12px;
  }
  .content{
    cursor: pointer;
    img{
      width: 100%;
      height: 250px;
      object-fit: cover;
    }
    .handle-button{
      position: relative;
      left:50%;
      transform: translateX(-50%);
    }
  }
}
</style>

<style>
.media-item .ivu-card-head{
  padding:5px;
  overflow: hidden;
}
</style>
